package com.spzx.user.controller;

import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.user.domain.Region;
import com.spzx.user.service.IRegionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName RegionController
 * @Author 波
 * @Date 2024/8/3 18:32
 */
@RestController
@RequestMapping("/region")
@Tag(name = "省市县接口管理")
public class RegionController extends BaseController {
    @Autowired
    private IRegionService regionService;

    @Operation(summary = "查询省市县的信息")
    @GetMapping("/treeSelect/{parentCode}")
    public AjaxResult treeSelect(@PathVariable String parentCode) {
        List<Region> regionList = regionService.treeSelect(parentCode);
        return success(regionList);

    }



}
